﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace AIniciacao.Lib.Sprites
{
    public class PersonagemAnimation
    {
        public Dictionary<string, Animation> Animations =
            new Dictionary<string, Animation>();

        public string currentAnimation;
        public string lastAnimation;
        public Vector2 Position = new Vector2(400, 300);

        public void AddAnimation(Animation animation, string AnimationName)
        {
            Animations.Add(AnimationName, animation);
        }

        public void changeAnimation(string AnimationName)
        {
            currentAnimation = AnimationName;
        }

        public void Update(GameTime gameTime)
        {

            Animations[currentAnimation].Update(gameTime);
        }

        public void Draw( SpriteBatch spriteBatch)
        {
            Animations[currentAnimation].Draw( spriteBatch, Position);
        }

    }
}
